@extends('home.layout.base')
@section('scripts')
    <script>
        $(function () {
            {{--highlight_subnav("{{ route('advert.index.index') }}");--}}
            $('.project-menu ul li').click(function(){
                $(this).siblings().children('a').removeClass("active");
                $(this).children('a').addClass("active");
                let name = $(this).attr('name');
                if(name == 'base'){
                    $('.project-info .main-project-base').show();
                    $('.project-info .main-list-item').hide();
                }
                if(name == 'new'){
                    $('.project-info .main-project-base').hide();
                    $('.project-info .main-list-item').show();
                }
            })
            $('.item-article').click(function(){
                let id = $(this).attr('data-id');
                window.location.href = "{{ route('home.new.info') }}"+'?id='+id;
            });
            $('.go-new').click(function(){
                window.location.href = "{{ route('home.new.index') }}";
            });
        })
    </script>
@endsection
@section('content')
    <div class="container main project">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 project-info">
                    <div class="col-lg-2 detail-thumb">
                        <img src="{{ $info['thumb'] }}" alt="">
                    </div>
                    <div class="col-lg-8 detail-go">
                        <p class="detail-title"> {{ $info['title'] }} <button>{{ $info['cate']['name'] }}</button></p>
                        <p class="detail-note"> {{ $info['summary'] }}</p>
                        <p class="detail-time">
                            <i class="fa fa-map-marker"></i> &nbsp;{{ $info['region'] }}
                            <i class="fa fa-eye"></i> &nbsp;{{ $info['view'] }}
                            <i class="fa fa-tag"></i> &nbsp;{{ $info['explain'] }}
                            <i class="fa fa-clock-o"></i> &nbsp;{{ $info['online'] }}上线
                        </p>
                        <p class="detail-home"> 官网：{{ $info['home_link'] }}</p>
                        <p class="detail-chrome"> 区块链浏览器：{{ $info['chrome_link'] }}</p>
                    </div>
                    <div class="col-lg-2 detail-link">
                        <ul>
                            <li><a target="_blank" href="{{ $info['home_link'] }}">进入官网</a></li>
                            <li><a target="_blank" href="{{ $info['white_link'] }}">查看白皮书</a></li>
                            <li><a target="_blank" href="{{ $info['github_link'] }}">GitHub</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container main">
        <div class="container">
            <div class="row">
                <div class="col-lg-12" style="padding-right: 30px;">
                    <div class="project-menu">
                        <ul>
                            <li name="base"><a class="active">基本信息</a></li>
                            <li name="new"><a>相关资讯</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="container main project-info">
        <div class="row">
            <div class="col-lg-8">
                <div class="col-lg-12 main-project-base" style="line-height: 25px">
                    <h4>项目简介</h4>
                    {{ $info['introduce'] }}
                    <h4 style="margin-top: 25px">项目成员</h4>
                    {{ $info['member'] }}
                    <h4 style="margin-top: 25px">项目亮点</h4>
                    {{ $info['merit'] }}
                    <h4 style="margin-top: 25px">应用场景</h4>
                    {{ $info['scene'] }}
                    <h4 style="margin-top: 25px">合作伙伴</h4>
                    {{ $info['partner'] }}
                    <h4 style="margin-top: 25px">交易平台</h4>
                    {{ $info['platform'] }}
                </div>
                <div class="col-lg-12 main-list-item">
                    @foreach($news as $new)
                    <div class="item-article" data-id="{{ $new['id'] }}">
                        <div class="item-article-img">

                            @if($new['cateChild']['name'])
                                <span class="tag-name">{{ $new['cateChild']['name'] }}</span>
                            @else
                                <span class="tag-name none"></span>
                            @endif
                            <img src="{{ $new['thumb'] }}" alt="">
                        </div>
                        <div class="item-article-info">
                            <p class="item-article-info-title">{{ $new['title'] }}</p>
                            <p class="item-article-info-note">{{ $new['summary'] }}</p>
                            <p class="item-article-info-other">
                                <img src="{{ $new['user']['avatar'] }}" alt="">
                                <span class="item-article-info-other-name">
                                            {{ $new['user']['truename'] }} <em>.</em> <i>{{ $new['created_at']->format('Y-m-d') }}</i>
                                        </span>
                                <span class="item-article-info-other-view"><i class="fa fa-eye"></i> {{ $new['praise'] }}&nbsp;&nbsp;&nbsp;&nbsp; <i class="fa fa-eye"></i> {{ $new['view'] }}</span>
                            </p>
                        </div>
                    </div>
                    @endforeach
                    <button class="item-article-more go-new">查看更多 >> </button>
                </div>
            </div>
            <div class="col-lg-4">
                <div class="col-lg-12 right-about">
                    <h4>相关项目</h4>
                    @foreach($porjects as $porject)
                    <div class="col-lg-6 right-about-item item-one">
                        <a href="{{ route('home.project.info',['id'=>$porject['id']]) }}">
                            <img src="{{ $porject['thumb'] }}" alt="">
                            <div class="about-item-title">
                                {{ $porject['title'] }}
                            </div>
                        </a>
                    </div>
                    @endforeach
                </div>
            </div>
        </div>
    </div>
@endsection

